package liangtWorkSpace.springTest.aopjdbc;

import liangtWorkSpace.springTest.aopjdbc.service.AccountService;
import org.junit.jupiter.api.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author liangt
 * @ClassName: AOPJBDBCTest
 * @title: AOPJBDBCTest
 * @projectName liangtWorkSpace.springTest.aopjdbc
 * @description: TODO
 * @date 2020/10/13 19:30
 */
public class AOPJBDBCTest {
    @Test
    public void test() {
        // 获得Spring容器，并操作
        String xmlPath = "applicationContextJDBC.xml";
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext(
                xmlPath);
        AccountService accountService = (AccountService) applicationContext
                .getBean("accountService");
        accountService.transfer("zhangsan", "lisi", 100);
    }
}
